/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ejb.metier;

import com.ejb.persistence.Author;
import com.ejb.persistence.Book;
import com.ejb.persistence.BookCategory;
import java.util.List;
import javax.ejb.Local;
import java.lang.*;
import java.util.Date;

/**
 *
 * @author Adel Boukelt
 * Class used to manage books
 */
@Local
public interface IBookManager {

    public List<Book> getMostSold();

    public java.util.List<Book> getBooks(String searchType, String searchName,BookCategory category);
    public List<Book> getAllBooks();
    public List<Book> getBooksByCategory(BookCategory category);
    public List<Author> getBookAuthors(Long bookId);
    public List<Author> getAllAuthors();
    public Book getBookById(Long bookId);
    public boolean insertBook(String title,float price, int stock, int threshold, String cover, String editor, Date publicationDate, String summary, String contents, boolean available, List<String> authorsId, BookCategory category);
    public boolean updateBook(Book book, List<String> authorsId); 
    public List<Book> getStockUnderThreshold();
    public boolean createAuthors (String firstName, String lastName);
}
